import request from '@/utils/request'


// GET

// 获取当前区域设备状态
export function getDeviceStatus(regionId) {
    return request({
        url: '/device/door/assemblyDesData',
        method: 'get',
        params: { regionId }
    })
}

//获取区域控件
export function getAreaControl(regionId) {
    return request({
        url: '/device/function/list',
        method: 'get',
        params: { regionId }
    })
}


//全开/全关 （门）
export function allOnOff(type,regionId,funId) {
    return request({
        url: '/server/doorControl/fullOpenClose',
        method: 'get',
        params: { type,regionId,funId }
    })
}



// POST
//控制门的开关 doorControl
export function doorControl(doorId,highLowSpeed,openCloseDoor) {
    return request({
        url: '/server/doorControl',
        method: 'post',
        data: { doorId,highLowSpeed,openCloseDoor}
    })
}

//PUT 

//上锁 
export function lock(doorId,type) {
    return request({
        url: '/device/door/lockOrUnLock',
        method: 'put',
        data: { doorId,type}
    })
}

//DEL 
export function clearExe(doorId) {
    return request({
        url: '/server/doorControl/clearExe/'+ doorId,
        method: 'delete',
    })
}